<?php

define('ROOT_PATH', '/home/shupeng/dw');
#define('ROOT_PATH', '/home/qss/shupeng/dw');
define('COMMON_PATH', ROOT_PATH . '/common');
define('SCHEDULER_PATH', ROOT_PATH . '/scheduler');
define('EXECUTOR_PATH', ROOT_PATH . '/executor');
define('FRONTEND_PATH', ROOT_PATH . '/frontend');
define('API_PATH', ROOT_PATH . '/api');
define('CONSOLE_PATH', ROOT_PATH . '/console');

Yii::setPathOfAlias('root', ROOT_PATH);

// common constant class definition
class Priority
{
    const Normal = 0;
    const High = 1;
    const VeryHigh	= 2;

    static $names = array(
        '0' =>  'NORMAL',
        '1' =>  'HIGH',
        '2' =>  'VERY_HIGH',
    );
    
    static $labels = array(
        '0' =>  '普通',
        '1' =>  '高',
        '2' =>  '非常高',
    );

}

class JobState
{
    const Submit = 0;
    const Done = 1;
    const Removed = 2;
}

class JobType
{
	const Query = 0;
	const Transfer = 1;
	const Compute = 2;
    static $names = array(
        '0' =>  '查询作业',
    	'1' =>  '传输作业',
        '2' =>  '计算作业',
    );
}

class TaskType
{
	const Query = 0;
	const Transfer = 1;
	const Compute = 2;
	static $names = array (
        '0'     =>  '查询任务',
        '1'     =>  '传输任务',
        '2'     =>  '计算任务',
    );
}

class TaskState
{
    const Waiting = 0;
    const Ready = 1;
    const Running = 2;
    const Done = 3;

    const Pending = 9;

    const Failed = 100;
    const Killed = 101;

    static $names = array (
        '0'     =>  '阻塞',
        '1'     =>  '就绪',
        '2'     =>  '运行',
        '3'     =>  '完成',
        '9'     =>  '挂起',
        '100'   =>  '失败',
        '101'   =>  '杀死',
    );
}

class CommandType
{
	const RunJob = 0;
	const RerunTask = 1;
	const ResumeTask = 2;
	const KillTask = 3;

    static $names = array(
        '0' =>  '运行作业',
        '1' =>  '重新运行',
        '2' =>  '恢复执行',
        '3' =>  '杀死任务',
    );
}

class CmdState
{
    const Submit = 0;
    const Done = 2;
    const Failed = 3;

    static $names = array (
        '0' =>  '提交',
        '2' =>  '完成',
        '3' =>  '失败',
    );
}

class MapRedType
{
    const Native = 0;
    const Streaming = 1;

    static $names = array(
        '0' => 'Native Java',
        '1' => 'Streaming',
    );
}

class ActivityType
{
	const MapRed = 0;
	const HiveCli = 1;
	const MysqlCli = 2;
	const Shell = 3;
	const DataX = 4;
	const Executable = 5;
	
	static $names = array (
        '0' =>  'MapRed活动',
        '1' =>  'Hive活动',
        '2' =>  'Mysql活动',
        '3' =>  'Shell活动',
        '4' =>  'DataX活动',
        '5' =>  'Executable活动',
    );
}

class ResourceType
{
	const Log = 0;
    const RelyFile = 1;
	const QueryOutput = 2;
	const ComputeOutput = 3;
	
	static $names = array (
        '0' =>  '原始日志',
        '1' =>  '依赖文件',
        '2' =>  '查询输出',
        '3' =>  '计算输出',
    );
}

class DependType
{
    const Input = 0;
    
    static $names = array(
    	'0'	=>	'输入',
    	'1'	=>	'依赖'
    );
}

class PhysicalType
{
	const Hdfs = 0;
	const Hive = 1;
	const Hbase = 2;
	const Database = 3;
	const Kv = 4;
	const LocalFile = 5;
	const RemoteFile = 6;

    static $names = array(
        '0' =>  'HDFS文件系统',
        '1' =>  'Hive数据仓库',
        '2' =>  'HBase表',
        '3' =>  '数据库',
        '4' =>  'KV存储引擎',
        '5' =>  '本地文件',
        '6' =>  '远程文件',
    );
}

class SpecialPartition
{
	const None = '_empty_';
}

class Frequency
{
    const None = 0;
    const TenMinutes = 10;
    const Quater = 15;
    const HalfHour = 30;
    const Day = 1440;
    const Hour = 60;

    static $names = array(
        '0'     =>  '无',
        '10'    =>  '十分钟',
        '15'    =>  '十五分钟',
        '30'    =>  '半小时',
        '60'    =>  '小时',
        '1440'  =>  '天',
    );
}

class MachineState
{
	const Online = 0;
	const Offline = 1;
	
	static $names = array(
        '0'	=>  '在线',
        '1' =>  '已下线',
    );
}

class Role
{
    const Normal = 0;
    const Admin = 1;

    static $names = array(
        '0' =>  '普通用户',
        '1' =>  '管理员',
    );
}

class QualityLevel
{
    const OfflineEphemeral = 0;
    const OfflineRoutine = 1;
    const OnlineRoutine = 2;
    const OnlineKpi = 3;
    static $names = array(
        '0' =>  '调研-临时',
        '1' =>  '调研-例行',
        '2' =>  '线上-例行',
        '3' =>  '线上-KPI',
    );
}

class SecurityLevel
{
    const Black = 70;
    const Gray = 40;
    const White = 2;
    const Sysfile = 3;
    static $names = array(
        '70' =>  '木马文件',
        '1' =>  '调研-例行',
        '2' =>  '线上-例行',
        '3' =>  '线上-KPI',
    );
}

class TimeSpan
{
    const Select = -1;
    const Today = 0;
    const Week = 1;
    const Month = 2;
    const Year = 3;

    static $names = array(
        '-1'=>  '请选择',
        '0' =>  '当日内',
        '1' =>  '本周内',
        '2' =>  '本月内',
        '3' =>  '本年内',
    );
}

class Trigger
{
    const Manual = 0;
    const Auto = 1;
    static $names = array(
        '0' =>  '手动',
        '1' =>  '自动',
    );
}
